#ifndef CHANGE_H
#define CHANGE_H

#include "Change/message.h"
#include <QByteArray>
#include <QDataStream>

class Change : public Message
{
public:
	Change() {}
	Change(opType newOp, int newRev, int newUser, int newDoc, int newPos);
	Change(QByteArray bytes);

	void setRevId(int newRev) {revisionId = newRev;}
	void setUserId(int newUser) {userId = newUser;}
	void setDocId(int newDoc) {docId = newDoc;}
	void setPosition(int newPos) {position = newPos;}

	int getRevId() {return revisionId;}
	int getUserId() {return userId;}
	int getDocId() {return docId;}
	int getPosition() {return position;}

	QByteArray toBytes();

protected:
	int revisionId;
	int userId;
	int docId;
	int position;
};

#endif // CHANGE_H
